﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Linq.Mapping;
using System.Data.Linq;
namespace MRSite.Entity
{
    /// <summary>
    /// 转账明细
    /// </summary>
    [Table(Name = "transfer")]
    public class Transfer : Entity
    {
        /// <summary>
        ///
        /// </summary>
        [Column(Name = "id", IsPrimaryKey = true, CanBeNull = false, IsVersion = true)]
        public override int id { get; set; }

        /// <summary>
        /// 转帐用户id
        /// </summary>
        [Column(Name = "zzuserid")]
        public int zzuserid { get; set; }

        /// <summary>
        /// 转帐用户名
        /// </summary>
        [Column(Name = "zzusername")]
        public string zzusername { get; set; }

        /// <summary>
        /// 转帐手机号
        /// </summary>
        [Column(Name = "zzmobile")]
        public string zzmobile { get; set; }

        /// <summary>
        /// 转帐直接姓名
        /// </summary>
        [Column(Name = "zzrealname")]
        public string zzrealname { get; set; }

        /// <summary>
        /// 接收方 用户id
        /// </summary>
        [Column(Name = "mbuserid")]
        public int mbuserid { get; set; }

        /// <summary>
        /// 接收方 用户名
        /// </summary>
        [Column(Name = "mbusername")]
        public string mbusername { get; set; }

        /// <summary>
        /// 接收方 手机号
        /// </summary>
        [Column(Name = "mbmobile")]
        public string mbmobile { get; set; }

        /// <summary>
        /// 接收方直接姓名
        /// </summary>
        [Column(Name = "mbrealname")]
        public string mbrealname { get; set; }

        /// <summary>
        /// 数量/金额
        /// </summary>
        [Column(Name = "fee")]
        public Decimal fee { get; set; }

        /// <summary>
        ///币种:XJB现金币,CFXFB重复消费币,GWB购物币
        /// </summary>
        [Column(Name = "feetype")]
        public String feetype { get; set; }

        /// <summary>
        /// 交易类型
        /// </summary>
        [Column(Name = "typefee")]
        public String typefee { get; set; }

        /// <summary>
        ///
        /// </summary>
        [Column(Name = "remark")]
        public String remark { get; set; }

        /// <summary>
        ///
        /// </summary>
        [Column(Name = "addtime",IsDbGenerated=true)]
        public DateTime addtime { get; set; }

        /// <summary>
        ///实发金额
        /// </summary>
        [Column(Name = "sfamount")]
        public Decimal sfamount { get; set; }

        /// <summary>
        ///手续费
        /// </summary>
        [Column(Name = "handlingfee")]
        public Decimal handlingfee { get; set; }

        /// <summary>
        ///费率
        /// </summary>
        [Column(Name = "rates")]
        public Decimal rates { get; set; }

         /// <summary>
        /// 价格
        /// </summary>
        [Column(Name = "price")]
        public Decimal price { get; set; }
        
        /// <summary>
        /// 状态：0未确认；1：已确认；2：取消
        /// </summary>
        [Column(Name = "status")]
        public int status { get; set; }

        /// <summary>
        /// 确认时间
        /// </summary>
        [Column(Name = "checktime")]
        public DateTime? checktime { get; set; }

        /// <summary>
        /// 返手续费状态：0未返；1：已返；
        /// </summary>
        [Column(Name = "returnstatus")]
        public int returnstatus { get; set; }

        /// <summary>
        /// 返手续费时间
        /// </summary>
        [Column(Name = "returntime")]
        public DateTime? returntime { get; set; }


        private EntityRef<Customer> _member;
        /// <summary>
        /// 
        /// </summary>
        [Association(Storage = "_member", ThisKey = "zzuserid", OtherKey = "id")]
        public Customer ZzCustomerItem
        {
            get { return this._member.Entity; }
            set { this._member.Entity = value; }
        }
    }
}
